<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>arkever</title>
</head>
<body>
  <h3>Arkever</h3>
  <div>
    <p>this is arkever, welcome to here.</p>
    <p>time: <span id="TIME"></span></p>
  </div>
  <!-- <script src="./arkever.umd.min.js">
    // 通过全局变量名使用
  </script> -->
  <script type="module">
    import arkever from './arkever.esm.js'

    console.log('this: ', this) // undefined
    console.log('window: ', window) // window

    const TIMEDOM = window.document.getElementById('TIME')
    TIMEDOM.innerHTML = arkever.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')
    setInterval(() => {
      TIMEDOM.innerHTML = arkever.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')
    }, 1000)

    console.log('日期格式化: ', arkever.formatDate(new Date(), 'yyyy.MM.dd hh:mm:ss t w'))
    console.log('时间戳格式: ', arkever.formatDate(1686903114621, 'yyyy年MM月dd hh:mm:ss'))

    console.log('金额格式化: ', arkever.formatMoney(987654321))
    console.log('金额格式化: ', arkever.formatMoney(987654321, 2))
    console.log('金额格式化: ', arkever.formatMoney(987654321.23, 1))

    console.log('手机号加密: ', arkever.encryptPhone(96512453652))
    console.log('手机号加密: ', arkever.encryptPhone(19901704827))

    console.log('url参数解析: ', arkever.url.parse('https://www.baidu.com/res/entry/home.html?name=ark&age=100'))
    console.log('url获取参数name: ', arkever.url.get('name', 'https://www.baidu.com/res/entry/home.html?name=ark&age=100'))
    console.log('url链参拼接: ', arkever.url.concat('https://www.baidu.com/res/entry/home.html', { name: 'ark', age: 100 }))

    console.log('是否身份证号: ', arkever.isCreditId('36232319900908541X'))
  </script>
</body>
</html>